package vcp.client.forms;

import org.joda.time.DateTime;

import vcp.entity.Complaint;
import vcp.enums.ComplaintType;
import vcp.enums.ComplaintType.ComplaintStatus;
import vcp.enums.FormType;
import vcp.enums.SiteEnum;

/**
 * 
 * @author VCP team
 *         <p>
 *         Complain form type
 *         </p>
 * 
 * @see FormType
 * @see Complaint
 * @see DateTime
 */
public class ComplaintForm extends FormAbstract
{
	/**
	 * 
	 */
	private static final long serialVersionUID = - 2868390527269522907L;
	/** instance of complain form **/
	private final Complaint complaint;

	public Complaint getComplaint ()
	{
		return this.complaint;
	}

	/**
	 * <p>
	 * fill the complain for with data
	 * </p>
	 * 
	 * @param type
	 * @param complaintText
	 * @param openDate
	 * @param siteEnum
	 */
	public ComplaintForm ( ComplaintType type, String complaintText, DateTime openDate, SiteEnum siteEnum )
	{
		super(FormType.COMPLAINT);
		this.complaint = new Complaint();

		this.complaint.setType(type);
		this.complaint.setText(complaintText);
		this.complaint.setOpenDate(openDate);
		this.complaint.setSiteEnum(siteEnum);
		this.complaint.setStatus(ComplaintStatus.OPENED);
	}
}
